package com.yt.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.context.annotation.Primary;

import javax.persistence.*;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString

@ApiModel(description = "Author", value = "Author")
@Table(name = "author")
public class Author {
    @ApiModelProperty(value = "作者编号", required = false)
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="id")
        Integer id;
    @ApiModelProperty(value = "作者姓名", required = false)
    @Column(name="author")
    String author;
    @ApiModelProperty(value = "作者写的小说", required = false)
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "aid")
    List<Novel> novels;
}
